home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / misc1.doc < prev    next >
Text File  |  1995-03-31  |  4KB  |  124 lines

  1. (User.programs) 
  2. Item: 367 by akcs.softcalc@hpcvbbs.cv.hp.com 
  3. Author: [brian maguire] 
  4.   Subj: Miscellaneous utilities 
  5.   Date: Sun Mar 22 1992 
  6.  
  7. MISC1 : Miscellaneous Utilities 1 
  8.  
  9. Copyright 1991 
  10. Brian J. Maguire 
  11. All Rights Reserved 
  12.  
  13. MISC1 and this manual are presented without warranties, expressed 
  14. or implied.  The author makes no guarantee as to the fitness of 
  15. this software. 
  16.  
  17. MISC1 can be copied freely provided the software and this manual 
  18. are copied in its entirety.  The user cannot be charged, in whole 
  19. or in part, except for the cost of reproduction.  No part of this 
  20. package may be used for commercial purposes without written 
  21. permission from the author. 
  22.  
  23. Please forward comments or questions to... 
  24.  
  25. Brian Maguire 
  26. 139 Kingsbury 
  27. Dearborn, MI 48128 
  28. (313) 274-0428 
  29.  
  30. SUMMARY 
  31.  
  32. For quite some time I have been designing several tool libraries. 
  33. While reviewing them, several commands were eliminated because 
  34. they were impractical.  Rather than just throwing them in the 
  35. fire, I decided to release them in the public domain. 
  36.  
  37. A brief listing of the programs in UTIL1 is given below.  Each 
  38. name is followed by a brief description and the INPUT->OUTPUT 
  39. object types. 
  40.  
  41. CSTK 
  42. Checks a list of object type numbers with the stack.  Each number 
  43. in the list on level one specifies a stack level.  If fewer 
  44. objects are on the stack than specified by the list, -1 is 
  45. returned.  If the objects on the stack match the list, 1 is 
  46. returned.  Otherwise 0 is returned.  As an example, if the stack 
  47. is setup as shown below and CSTK is run, 1 is returned. NOTE: 
  48. Using 27 in the object type list passes all object type in that 
  49. stack position.  [If you're like me and can't remember all the object 
  50. type numbers, use TSTK, described below, to find them.  -jkh-] 
  51.  
  52. Before                       After 
  53. ------                       ----- 
  54. 4: 'VAR'                     4: 'VAR' 
  55. 3: 45                        3: 45 
  56. 2: "Answer "                 2: "Answer " 
  57. 1: { 6 0 2 }                 1: 1 
  58.  
  59. List  ->  Real(-1, 0, or 1) 
  60.  
  61. TSTK 
  62. Returns a list of object type numbers representing the objects on 
  63. the stack.  The real number input on level one specifies the 
  64. number of stack levels to check.  As an example,  entering TSTK 
  65. with the before stack shown below will return the after stack. 
  66.  
  67. Before                    After 
  68. ------                    ----- 
  69. 5: 'PRG1'                 5: 'PRG1' 
  70. 4: << 2 / >>              4: << 2 / >> 
  71. 3: 2                      3: 2 
  72. 2: "Name "                2: "Name " 
  73. 1: 4                      1: { 6 8 0 2 } 
  74.  
  75. Obj(n)...Obj(1), Real(n)   ->   Obj(n)...Obj(1), List 
  76.  
  77. TCOUNT 
  78. Returns the number of occurrences of an object type found in the 
  79. list on level two.  The real number on level one specifies the 
  80. object type.  TCOUNT can be used to validate user input lists. 
  81. For example, the program 
  82.  
  83. << IF DUP SIZE OVER 6 TCOUNT == 
  84.     THEN <valid procedure> 
  85.     ELSE <failed procedure> 
  86.     END >> 
  87.  
  88. check for a list of global names on the stack.  If the test is 
  89. true the appropriate procedure is run.  Otherwise, <failed 
  90. procedure> is run. 
  91.  
  92. List, Real  ->  Real 
  93.  
  94. TPOS 
  95. Returns the position of the first occurrence of an object type in 
  96. a list.  The real number on level one specifies the object type 
  97. to be searched for.  0 is returned if the object type is not 
  98. found 
  99.  
  100. List, Real  ->  Real 
  101.  
  102. OCOUNT 
  103. Returns the number of times the object on level one occurs in the 
  104. list on level two. 
  105.  
  106. List, Any  ->  Real 
  107.  
  108. STOPATH 
  109. STOPATH stores an object in a different directory without 
  110. changing directories.  If the global name on level one exists 
  111. anywhere along the current path, its contents is replaced with 
  112. the object on level two.  Otherwise, a new variable is created in 
  113. the current directory. 
  114.  
  115. Any, Global  ->  Object on level two stored in global name 
  116.  
  117. ->STR1 
  118. Converts the object on level one into a string without carriage 
  119. returns.  Spaces are the only separator character used. 
  120.  
  121. Any  ->  String 
  122.  
  123.  -Brian Maguire- 
  124.